package cn.mw.cmdb.entity;

import cn.mw.cmdb.param.QueryMonitorParam;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.google.common.base.Strings;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

import static cn.mw.cmdb.enums.DefaultMonitorTabEnum.monitorTarget;

/**
 * 监控布局Tab标签栏
 */
@Data
public class MwLayoutLabelInfo extends QueryMonitorParam {
    public static final String overView = "概览";
    public static final String monitorTargetKey = monitorTarget.getName();

    @Schema(description = "id")
    private String id;

    @Schema(description = "ids")
    private List<String> ids;

    @Schema(description = "布局Tab名称")
    private String name;


    public List<String> getConvertIds(){
        if(!Strings.isNullOrEmpty(id) && CollectionUtils.isEmpty(ids)){
            ids = new ArrayList<>();
            ids.add(id);
        }
        return ids;
    }
}
